package nz.ac.massey.se.Q7A;

public class MandarinSpanishTranslator implements SpanishTranslator {

    private EnglishTranslator englishTranslator;
    private SpanishTranslator spanishTranslator;

    public MandarinSpanishTranslator(EnglishTranslator englishTranslator, SpanishTranslator spanishTranslator) {
        this.englishTranslator = englishTranslator;
        this.spanishTranslator = spanishTranslator;
    }

    @Override
    public String toSpanish(String word) {
        String english = this.englishTranslator.toEnglish(word);
        return this.spanishTranslator.toSpanish(english);
    }
}
